<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>游戏后台管理系统 | 登录</title>
    <link rel="stylesheet" href=" https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css ">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
        }

        body {
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            background: linear-gradient(135deg, #1a2a6c, #b21f1f, #1a2a6c);
            background-size: 400% 400%;
            animation: gradientBG 15s ease infinite;
            padding: 20px;
        }

        @keyframes gradientBG {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }

        .login-container {
            width: 100%;
            max-width: 420px;
            background: rgba(255, 255, 255, 0.08);
            backdrop-filter: blur(12px);
            border-radius: 16px;
            padding: 40px 30px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
            border: 1px solid rgba(255, 255, 255, 0.1);
            transform: translateY(0);
            transition: transform 0.4s ease, box-shadow 0.4s ease;
            will-change: transform; /* 提前告知浏览器准备优化 */
        }

        /* 优化悬停效果 - 改为缩放而非位移 */
        .login-container:hover {
            transform: scale(1.02); /* 改为缩放效果避免抖动 */
            box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
        }

        .header {
            text-align: center;
            margin-bottom: 35px;
        }

        .logo {
            width: 80px;
            height: 80px;
            background: linear-gradient(135deg, #ff8a00, #e52e71);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 15px;
            box-shadow: 0 4px 20px rgba(229, 46, 113, 0.5);
        }

        .logo i {
            font-size: 40px;
            color: white;
        }

        .header h1 {
            color: white;
            font-size: 28px;
            font-weight: 600;
            letter-spacing: 1px;
            margin-bottom: 8px;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
        }

        .header p {
            color: rgba(255, 255, 255, 0.7);
            font-size: 16px;
        }

        .form-group {
            position: relative;
            margin-bottom: 25px;
            transition: transform 0.3s ease; /* 添加过渡效果 */
        }

        .form-group:focus-within {
            transform: scale(1.02); /* 输入框聚焦时轻微放大 */
        }

        .form-group i {
            position: absolute;
            left: 15px;
            top: 50%;
            transform: translateY(-50%);
            color: rgba(255, 255, 255, 0.7);
            font-size: 18px;
            transition: color 0.3s ease;
        }

        .form-control {
            width: 100%;
            padding: 14px 14px 14px 45px;
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 8px;
            color: white;
            font-size: 16px;
            transition: all 0.3s ease;
        }

        .form-control::placeholder {
            color: rgba(255, 255, 255, 0.5);
        }

        .form-control:focus {
            outline: none;
            background: rgba(255, 255, 255, 0.15);
            border-color: rgba(255, 255, 255, 0.4);
            box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.2);
        }

        /* 输入框聚焦时图标颜色变化 */
        .form-group:focus-within i {
            color: #ff8a00;
        }

        .password-toggle {
            position: absolute;
            right: 15px;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            color: rgba(255, 255, 255, 0.7);
            cursor: pointer;
            font-size: 18px;
            transition: color 0.3s ease;
        }

        .password-toggle:hover {
            color: #ff8a00;
        }

        .options {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 25px;
            font-size: 14px;
        }

        .remember {
            display: flex;
            align-items: center;
            color: rgba(255, 255, 255, 0.7);
        }

        .remember input {
            margin-right: 8px;
            accent-color: #ff8a00;
        }

        .forgot-password {
            color: #ff8a00;
            text-decoration: none;
            transition: color 0.3s ease;
        }

        .forgot-password:hover {
            color: #ffad33;
            text-decoration: underline;
        }

        .login-btn {
            width: 100%;
            padding: 14px;
            background: linear-gradient(to right, #ff8a00, #e52e71);
            border: none;
            border-radius: 8px;
            color: white;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(229, 46, 113, 0.4);
            letter-spacing: 1px;
            position: relative;
            overflow: hidden;
            z-index: 1;
        }

        .login-btn::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(to right, #ff9a2d, #ff3b7d);
            transition: all 0.6s ease;
            z-index: -1;
        }

        .login-btn:hover::before {
            left: 0;
        }

        .login-btn:hover {
            box-shadow: 0 6px 20px rgba(229, 46, 113, 0.6);
        }

        .login-btn:active {
            transform: translateY(1px);
        }

        .footer {
            text-align: center;
            margin-top: 25px;
            color: rgba(255, 255, 255, 0.6);
            font-size: 14px;
        }

        .version {
            display: block;
            margin-top: 8px;
            font-size: 12px;
        }

        /* 响应式设计 */
        @media (max-width: 480px) {
            .login-container {
                padding: 30px 20px;
            }

            .header h1 {
                font-size: 24px;
            }

            .logo {
                width: 70px;
                height: 70px;
            }
        }
    </style>
</head>
<body>
<div class="login-container">
    <div class="header">
        <div class="logo">
            <i class="fas fa-gamepad"></i>
        </div>
        <h1>游戏后台管理系统</h1>
        <p>安全登录您的管理员账户</p>
    </div>

    <form id="loginForm">
        <div class="form-group">
            <i class="fas fa-user"></i>
            <input type="text" class="form-control" id="username" placeholder="用户名" required>
        </div>

        <div class="form-group">
            <i class="fas fa-lock"></i>
            <input type="password" class="form-control" id="password" placeholder="密码" required>
            <button type="button" class="password-toggle" id="togglePassword">
                <i class="fas fa-eye"></i>
            </button>
        </div>

        <div class="options">
            <label class="remember">
                <input type="checkbox"> 记住我
            </label>
            <a href="#" class="forgot-password">忘记密码?</a>
        </div>

        <button type="submit" class="login-btn">登 录</button>
    </form>

    <div class="footer">
        © 2025 游戏后台管理系统 | 管理员专用
        <span class="version">版本: v3.8.2</span>
    </div>
</div>

<script>
    // 密码显示/隐藏切换
    const togglePassword = document.getElementById('togglePassword');
    const passwordInput = document.getElementById('password');

    togglePassword.addEventListener('click', function() {
        const type = passwordInput.getAttribute('type') === 'password' ? 'text' : 'password';
        passwordInput.setAttribute('type', type);
        this.innerHTML = type === 'password' ? '<i class="fas fa-eye"></i>' : '<i class="fas fa-eye-slash"></i>';
    });

    // 表单提交处理
    const loginForm = document.getElementById('loginForm');

    loginForm.addEventListener('submit', function(e) {
        e.preventDefault();

        const username = document.getElementById('username').value;
        const password = document.getElementById('password').value;

        // 简单验证
        if(username.trim() === '' || password.trim() === '') {
            // 添加错误动画效果
            const inputs = document.querySelectorAll('.form-control');
            inputs.forEach(input => {
                if(input.value.trim() === '') {
                    input.style.animation = 'shake 0.5s';
                    setTimeout(() => {
                        input.style.animation = '';
                    }, 500);
                }
            });
            return;
        }

        // 这里添加实际的登录验证逻辑
        console.log('登录信息:', { username, password });

        // 模拟登录成功
        const loginBtn = document.querySelector('.login-btn');
        loginBtn.innerHTML = '<i class="fas fa-spinner fa-spin"></i> 登录中...';
        loginBtn.disabled = true;

        setTimeout(() => {
            alert('登录成功！正在跳转至控制面板...');
            // window.location.href = 'dashboard.html';
            loginBtn.innerHTML = '登 录';
            loginBtn.disabled = false;
        }, 1500);
    });

    // 输入框聚焦效果增强
    const inputs = document.querySelectorAll('.form-control');
    inputs.forEach(input => {
        input.addEventListener('focus', function() {
            this.parentElement.style.transform = 'scale(1.02)';
        });

        input.addEventListener('blur', function() {
            this.parentElement.style.transform = 'scale(1)';
        });
    });

    // 添加抖动动画关键帧
    const style = document.createElement('style');
    style.innerHTML = `
        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            25% { transform: translateX(-5px); }
            75% { transform: translateX(5px); }
        }
    `;
    document.head.appendChild(style);
</script>
</body>
</html>
